/**
 * 
 */
package demo.dcs.vo;

/**
 * @author mandy
 *
 */
public enum OnlineStatus {
	ON("on","on"),
	OFF("off","off"),
	OTHER("other","other");
	
	private String status;
	private String desc;

	OnlineStatus(String status, String desc) {
		this.status = status;
		this.desc = desc;
	}
	
	/**
	 * @return the status
	 */
	public String getStatus() {
	
		return status;
	}


	
	/**
	 * @param status the status to set
	 */
	public void setStatus(String status) {
	
		this.status = status;
	}


	/**
	 * @return the desc
	 */
	public String getDesc() {
	
		return desc;
	}

	
	/**
	 * @param desc the desc to set
	 */
	public void setDesc(String desc) {
	
		this.desc = desc;
	}

	/**
	 * 
	 * @param type
	 * @return
	 */
	public static OnlineStatus getEnum(String status) {
		for (OnlineStatus orderStatus : OnlineStatus.values()) {
			if (orderStatus.getStatus().equalsIgnoreCase(status)) {
				return orderStatus;
			}
		}

		return null;
	}

}
